<?php

use think\facade\Route;
use app\common\middleware\AdminAuthMiddleware;
use app\common\middleware\AdminTokenMiddleware;
use app\common\middleware\AllowOriginMiddleware;
use app\common\middleware\LogMiddleware;

Route::group(function () {

    Route::group('system/activity/lottery', function () {
        //抽奖活动列表
        Route::get('list', '.LuckLottery/index')->option(['real_name' => '抽奖活动列表']);
        //抽奖活动详情
        Route::get('detail/:id', '.LuckLottery/detail')->option(['real_name' => '抽奖活动详情']);
        //抽奖活动详情
        Route::get('factor_info/:factor', '.LuckLottery/factorInfo')->option(['real_name' => '抽奖活动详情']);
        //添加抽奖活动
        Route::post('add', '.LuckLottery/add')->option(['real_name' => '添加抽奖活动']);
        //修改抽奖活动数据
        Route::put('edit/:id', '.LuckLottery/edit')->option(['real_name' => '修改抽奖活动数据']);
        //删除抽奖活动
        Route::delete('del/:id', '.LuckLottery/delete')->option(['real_name' => '删除抽奖活动']);
        //设置抽奖活动是否显示
        Route::post('set_status/:id/:status', '.LuckLottery/setStatus')->option(['real_name' => '设置抽奖活动是否显示']);
        //抽奖记录列表
        Route::get('record/list', '.LuckLotteryRecord/list')->option(['real_name' => '抽奖记录列表']);
        //抽奖记录列表
        Route::get('record/list/:id', '.LuckLotteryRecord/index')->option(['real_name' => '抽奖记录列表']);
        //抽奖中奖发货、备注处理
        Route::post('record/deliver', '.LuckLotteryRecord/deliver')->option(['real_name' => '抽奖中奖发货、备注处理']);


    })->prefix('admin.activity.lottery')->option([
        '_path' => '/setting/ad/advert/list',
        '_auth' => true,
    ]);

    })->middleware(AllowOriginMiddleware::class)
    ->middleware(AdminTokenMiddleware::class, true)
    ->middleware(AdminAuthMiddleware::class)
    ->middleware(LogMiddleware::class);

